1. Technical Field
The present invention relates generally to a method and apparatus for gathering data to measure the performance of a computer program. More specifically, the present invention describes a way to periodically sample performance data during the execution of a computer program to determine the time it takes to perform certain operations.
2. Description of the Related Art
Measuring the performance of computer programs has always been difficult. As is true in many other disciplines, the more closely a system is monitored, the more the system is affected by the monitoring process. In computer programs, the more closely a program is monitored by another program, the more overhead the monitoring program imposes on the system executing the program being monitored. Often times, this overhead adversely affects the monitored program.
For example, one program may collect various information about another program executing on the same computer system every minute. Since the monitoring program only collects data every minute, the overhead imposed by this program is small compared to the monitored program. However, if the monitoring program attempted to collect the same information every tenth of a second, the processor upon which the monitored program is executing may spend as much time executing the monitoring program as it does the monitored program. In most instances, this situation would be unacceptable.
Thus, there exists a need to measure the performance of a computer program by imposing a minimum amount of overhead on the system executing the program. Such a measurement technique should be simple to implement and allow the rate at which data is sampled to be varied.